
package com.xg.model.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;

@Data
public class TwoData implements Styleable {

    @ExcelProperty("编号")
    @ColumnWidth(10)
    private Integer num;

    @ExcelProperty("名字")
    @ColumnWidth(10)
    private String name;

    @ExcelProperty("年龄")
    @ColumnWidth(10)
    private String age;

    @ExcelProperty("拼接")
    @ColumnWidth(30)
    private String description;

    @ExcelProperty("带括号的文本拼接")
    @ColumnWidth(50)
    private String textWithBrace;

    @ExcelIgnore
    private String operationType = "";

    @ExcelIgnore
    private String modifiedField = "";

    public TwoData(Integer num, String name, String age) {
        this.num = num;
        this.name = name;
        this.age = age;
        this.description = "今年" + name + "已经" + age + "岁了";
        this.textWithBrace = name + "的年龄是通过{.age}的方式传递过来的";
    }
    @Override
    public Integer getNum() {
        return num;
    }
    @Override
    public String getOperationType() {
        return operationType;
    }

    @Override
    public String getModifiedField() {
        return modifiedField;
    }
}